package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "MemberSetMeal", schema = "CubeLibrary", catalog = "")
public class MemberSetMealEntity {
    private int autoNumber;
    private int openTime;
    private Float money;
    private String value;
    private Integer originalPrice;

    @Id
    @Column(name = "AutoNumber", nullable = false)
    public int getAutoNumber() {
        return autoNumber;
    }

    public void setAutoNumber(int autoNumber) {
        this.autoNumber = autoNumber;
    }

    @Basic
    @Column(name = "OpenTime", nullable = false)
    public int getOpenTime() {
        return openTime;
    }

    public void setOpenTime(int openTime) {
        this.openTime = openTime;
    }

    @Basic
    @Column(name = "Money", nullable = false, precision = 2)
    public Float getMoney() {
        return money;
    }

    public void setMoney(Float money) {
        this.money = money;
    }

    @Basic
    @Column(name = "Value", nullable = true, length = 10)
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Basic
    @Column(name = "OriginalPrice", nullable = true)
    public Integer getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(Integer originalPrice) {
        this.originalPrice = originalPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MemberSetMealEntity that = (MemberSetMealEntity) o;
        return autoNumber == that.autoNumber &&
                openTime == that.openTime &&
                Objects.equals(money, that.money) &&
                Objects.equals(value, that.value) &&
                Objects.equals(originalPrice, that.originalPrice);
    }

    @Override
    public int hashCode() {
        return Objects.hash(autoNumber, openTime, money, value, originalPrice);
    }

    @Override
    public String toString() {
        return "MemberSetMealEntity{" +
                "autoNumber=" + autoNumber +
                ", openTime=" + openTime +
                ", money=" + money +
                ", value='" + value + '\'' +
                ", originalPrice=" + originalPrice +
                '}';
    }
}
